<html>
<head>
<#include "/common/common2.ftl"/>
</head>
<body>
	<div id="rrapp" v-cloak>
		<div v-show="showList">
			<div class="m-b-md">
				<form class="layui-form-layui-form-pane" role="form" id="searchForm" name="searchForm">
					<div class="layui-form-item">
						<label class="layui-form-label">帐号</label>
						<div class="layui-input-inline">
							<input type="text" name="username" id="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
						</div>
						<a href="javascript:void(0)" @click="reload" class="layui-btn layui-btn-normal" id="search">查询</a>
						<button type="button" @click="download" class="layui-btn layui-btn-normal" title="下载">
							<i class="fa fa-download "></i>
							导出
						</button>
						<button type="button" @click="del" class="layui-btn layui-btn-danger">删除</button>
						<button type="button" @click="toupdate" class="layui-btn layui-btn-normal">编辑</button>
					</div>
				</form>
			</div>
			<div class="table-responsive">
				<table class="layui-hide" id="usertable"></table>
			</div>
		</div>
		<div class="panel panel-default" v-show="!showList">
			<div class="panel-heading">{{title}}</div>
			<form class="layui-form-layui-form-pane">
				<div class="panel-body">
					<input type="hidden" v-model="user.id">
					<div class="layui-form-item">
						<label class="layui-form-label">用户名</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" disabled="disabled" required lay-verify="required" placeholder="请输入用户名" v-model="user.username">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">手机号码</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" required lay-verify="required" placeholder="请输入手机号码" v-model="user.phone">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">电子邮箱</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" required lay-verify="required" placeholder="请输入电子邮箱" v-model="user.email">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">所属角色</label>
						<div class="layui-input-block">
							<select v-select2="" class="select2" style="width: 100%;" multiple="multiple" data-placeholder="请选择角色" v-model="user.roleids" required lay-verify="required">
								<option v-bind:value="roleoption.id" v-for="roleoption in roleoptions">{{ roleoption.name }}</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否禁用</label>
						<div class="layui-input-block">
							<select class="layui-input" v-model="user.state" required lay-verify="required">
								<option value="lock">是</option>
								<option value="OK">否</option>
								<option value="die">未激活</option>
							</select>
						</div>
					</div>
				</div>
				<footer class="panel-footer text-right bg-light lter">
					<div class="layui-form-item">
						<input type="button" class="layui-btn layui-btn-normal" @click="update" value="确定" />
						&nbsp;&nbsp;
						<input type="button" class="layui-btn layui-btn-danger" @click="reload" value="返回" />
					</div>
				</footer>
			</form>
		</div>
	</div>
	<script type="text/javascript" src="/js/system/user/user.js"></script>
</body>
</html>